[LINUX] /proc/iomem should not be initialised from pseudophysical e820 map.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 31 Aug 2006 02:05:40 +0000 (03:05 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 31 Aug 2006 02:05:40 +0000 (03:05 +0100)
This is because it should only contain real I/O memory address ranges,
otherwise we can get false conflicts between a real I/O range and a
'pseudophysical' RAM range, causing drivers to fail to work in a domU.
Also prevent kernel code/data being requested as iomem resources --
they are not contiguous in 'io memory' space so this would not make
sense.

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c
linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c

index 3edae00dce580707e11924e16f9af7d35375779b..3457e31c8c4de5ccb76737858309ad40def8ffcc 100644 (file)
@@ -1380,8 +1380,10 @@ legacy_init_iomem_resources(struct e820entry *e820, int nr_map,
                         *  so we try it repeatedly and let the resource manager
                         *  test it.
                         */
+#ifndef CONFIG_XEN
                        request_resource(res, code_resource);
                        request_resource(res, data_resource);
+#endif
 #ifdef CONFIG_KEXEC
                        request_resource(res, &crashk_res);
 #endif
@@ -1454,11 +1456,8 @@ static void __init register_memory(void)
        int           i;
 
        /* Nothing to do if not running in dom0. */
-       if (!is_initial_xendomain()) {
-               legacy_init_iomem_resources(e820.map, e820.nr_map,
-                                           &code_resource, &data_resource);
+       if (!is_initial_xendomain())
                return;
-       }
 
 #ifdef CONFIG_XEN
        machine_e820 = alloc_bootmem_low_pages(PAGE_SIZE);
index 1dcaedc0d5195b50ce83c5f753bc78fb06d5a466..333a9a26f47a37f787f9c3d5697e108f189c2b9d 100644 (file)
@@ -255,8 +255,10 @@ void __init e820_reserve_resources(struct e820entry *e820, int nr_map)
                         *  so we try it repeatedly and let the resource manager
                         *  test it.
                         */
+#ifndef CONFIG_XEN
                        request_resource(res, &code_resource);
                        request_resource(res, &data_resource);
+#endif
 #ifdef CONFIG_KEXEC
                        request_resource(res, &crashk_res);
 #endif
index 96da64e242f2fd2f2910296e9005019cfcd82ba6..8fe13ee2b015ddcd111fea60150e21cc6bcf31d9 100644 (file)
@@ -944,9 +944,10 @@ void __init setup_arch(char **cmdline_p)
                BUG_ON(HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap));
 
                e820_reserve_resources(machine_e820, memmap.nr_entries);
-       } else
-#endif
+       }
+#else
        e820_reserve_resources(e820.map, e820.nr_map);
+#endif
 
        request_resource(&iomem_resource, &video_ram_resource);